package com.bank.service;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import jxl.write.WriteException;

import org.apache.log4j.Logger;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.bank.common.excelGenerator;
import com.bank.common.xmlGenerator;

@Service("ExportService")
@Transactional
public class ExportService{
	protected static Logger logger = Logger.getLogger("service");
	ArrayList<String> export = new ArrayList<String>();
	
	@Resource(name="sessionFactory")
	private SessionFactory sessionFactory;
	
	public void setPrevNumbers(ArrayList<String> export){
		this.export = export;	
	}
	public static String exportXML(List<List<String>> data){
		xmlGenerator exm = new xmlGenerator(); 
		return exm.createXML(data);
		
	}
	public static String exportExcel(List<List<String>> data) throws WriteException, IOException{
		excelGenerator exg = new excelGenerator(); 
		return exg.createExcel(data);
	}
}